<?php

namespace sample\controller;

use pmvc\mvc\controller\BaseController;
use pmvc\mvc\ModelAndView;
use pmvc\mvc\Dispatcher;
use pmvc\mvc\Model;

class HomePageController
	extends BaseController {

	public function handleRequest(Model $model, Dispatcher $dispatcher) {
		if (pmvc_getRequestParam("throwException", 0)=="1") {
			throw new \Exception("This is a sample error from the default error controller.");
		}
		$model->merge(Array(
	        "message" 	=> "Why hello there"
		));
		return parent::getDefaultViewName();
	}
}

?>